<?php
if(!defined('GbIncl')){?>
<meta http-equiv="refresh" content="0;url=block.php" />
<?php }else{?>
<div id="top">
    <?php include('logo.php')?>
	<div id='cssmenu'><!-- cssmenu -->
    	<ul><!-- MENU -->
        <?php if ($_GET['p']=='000'){?>
        	<li class="has-sub" id="selected"><a href="../spm-itats/">BERANDA</a></li>
        <?php }else{?>
        	<li class="has-sub"><a href="../spm-itats/">BERANDA</a></li>
        <?php }?>    
        <?php 	
        $MN= mysql_query("SELECT * FROM MENU_SPM WHERE PARENT_MENS=ID_MENS AND STATUS_MENS='0'");
        while ($DATAMN=mysql_fetch_array($MN)){ //MENU//?>
		<?php if ((substr($_GET['p'],0,1))==(substr($DATAMN['PARENT_MENS'],0,1))){?>
        	<li class="has-sub" id="selected"><?php echo "<a href=content.php?p=$DATAMN[ID_MENS]>$DATAMN[NAMA_MENS]</a>";?>
            	<ul>
				<?php $SMN =  mysql_query("SELECT * FROM MENU_SPM WHERE PARENT_MENS=$DATAMN[ID_MENS] AND PARENT_MENS!=ID_MENS AND STATUS_MENS='0'");
            	while ($DATASMN=mysql_fetch_array($SMN)){ //SUB-MENU//?>
                	<li><?php echo "<a href=content.php?p=$DATASMN[ID_MENS]>$DATASMN[NAMA_MENS]</a>";?></li><?php }?>
            	</ul>
        	</li>
            <?php }else{?>
                    <li class="has-sub"><?php echo "<a href=content.php?p=$DATAMN[ID_MENS]>$DATAMN[NAMA_MENS]</a>";?>
                        <ul>
                        <?php $SMN =  mysql_query("SELECT * FROM MENU_SPM WHERE PARENT_MENS=$DATAMN[ID_MENS] AND PARENT_MENS!=ID_MENS AND STATUS_MENS='0'");
                        while ($DATASMN=mysql_fetch_array($SMN)) { ?>
                            <li><?php echo "<a href=content.php?p=$DATASMN[ID_MENS]>$DATASMN[NAMA_MENS]</a>";?></li><?php }?>
                        </ul>
                    </li>
				<?php }?>
        <?php } ?>
    	</ul>
	</div>
</div>
<?php } ?>